package com.javacv.plus.extensions.analysis;

import lombok.Data;

/**
 * 图像质量分析报告
 */
@Data
public class ImageQualityReport {
    
    // 基本信息
    private int width;
    private int height;
    private int channels;
    
    // 亮度分析
    private double meanBrightness;
    private String brightnessLevel;
    
    // 对比度分析
    private double contrast;
    private String contrastLevel;
    
    // 清晰度分析
    private double sharpness;
    private String sharpnessLevel;
    
    // 噪声分析
    private double noiseLevel;
    private String noiseDescription;
    
    // 整体评分
    private double overallScore;
    private String qualityGrade;
    
    // 分析状态
    private boolean analysisSuccess = true;
    private String errorMessage;
    
    /**
     * 生成报告摘要
     */
    public String generateSummary() {
        if (!analysisSuccess) {
            return "图像分析失败: " + errorMessage;
        }
        
        StringBuilder summary = new StringBuilder();
        summary.append(String.format("图像质量分析报告\n"));
        summary.append(String.format("==================\n"));
        summary.append(String.format("图像尺寸: %dx%d\n", width, height));
        summary.append(String.format("通道数: %d\n", channels));
        summary.append(String.format("整体评分: %.1f/100 (%s)\n", overallScore, qualityGrade));
        summary.append(String.format("\n详细分析:\n"));
        summary.append(String.format("- 亮度: %.1f (%s)\n", meanBrightness, brightnessLevel));
        summary.append(String.format("- 对比度: %.1f (%s)\n", contrast, contrastLevel));
        summary.append(String.format("- 清晰度: %.1f (%s)\n", sharpness, sharpnessLevel));
        summary.append(String.format("- 噪声水平: %.1f (%s)\n", noiseLevel, noiseDescription));
        
        return summary.toString();
    }
} 